package com.itheima.controller;

import com.github.pagehelper.PageInfo;
import com.itheima.pojo.WebVisit;
import com.itheima.service.WebVisitService;
import com.itheima.vo.WebVisitVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 用户访问
 */
@Controller
@RequestMapping("/webVisit")
public class WebVisitController {
    @Autowired
    private WebVisitService webVisitService;

    /**
     * 获取用户访问列表
     * @param webVisitVo
     * @param model
     * @return
     */
    @PostMapping("/getList")
    @ResponseBody
    public PageInfo list(@RequestBody WebVisitVo webVisitVo, Model model){
     PageInfo<WebVisit> pageInfo = webVisitService.list(webVisitVo);
    model.addAttribute("pageInfo",pageInfo);
        //TODO  用户访问列表页面暂时没有
      return pageInfo;
    }
}
